<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./../templates/StakeholderPortalTemplate.xhtml">

    <ui:define name="content">
        <h:form>
            <f:view beforePhase="#{stakeholderPortalManagedBean.initView}">

                <p:panel header="#{bundle['stakeholder.management.portal']}" id="portalInfo" >


                    <p:messages id="statusMessages" redisplay="false" />
                    <h:panelGrid columns="3" cellpadding="1" cellspacing="2" id="portalInfoGrid" >
                        <br/>
                        <h:outputText value="Please enter details about your business and ensure that information is correct as it will be made public." 
                                      style="font-size: 10px; color: grey; float: left;"/>
                        <br/>

                        <h:outputText value="#{bundle['stakeholder.desc.label']}" />

                        <p:inputTextarea id="sDesc" value="#{stakeholderPortalManagedBean.stakeholderAccountState.stakeholderDesc}"
                                         style="width:550px; height:80px;" required="true" requiredMessage="Please fill in Stakeholder Description. It is neccessary"/>
                        <p:message for="sDesc"/>

                        <br/>
                        <h:outputText value="Please update a image of your brand. Size: (560px x 270px)" style="font-size: 10px; color: red; float: right;"/>
                        <br/>

                        <h:outputText value="#{bundle['stakeholder.pimg.label']}" style="height:inherit;"/>
                        <p:graphicImage id="imagePreview" value="#{stakeholderPortalManagedBean.stakeholderAccountState.imgUrl}" style="width: 560px; height: 270px;
                                        position:relative;"/>

                        <br />
                        <br /><!--end for 2nd column-->


                        <br/> 
                        <h:outputLabel />

                        <p:fileUpload label="Upload Image" fileUploadListener="#{stakeholderPortalManagedBean.handleImageUpload}"
                                      auto="true"
                                      update="imagePreview, statusMessages" style="float: right"/>
                        <br/>


                        <br/>
                        <h:column></h:column>
                        <h:column id="buttons">
                            <p:commandButton actionListener="#{stakeholderPortalManagedBean.redirectPage}" 
                                             value ="#{bundle['preview.stakeholderportal']}"
                                             style="float:right;"/>      
                            <p:commandButton actionListener="#{stakeholderPortalManagedBean.saveStakeholderPortalInfo}" 
                                             update="statusMessages" value="#{bundle['btnSave']}" 
                                             style="float:right;"/>


                        </h:column>

                    </h:panelGrid>


                </p:panel>



            </f:view>
        </h:form>
    </ui:define>
</ui:composition>
